0 JBC
↳1 JBC2FIG (⇒)
↳2 JBCTerminationGraph
↳3 FIGtoITRSProof (⇒)
↳4 AND
↳5 IDP
↳6 IDPNonInfProof (⇒)
↳7 AND
↳8 IDP
↳9 IDependencyGraphProof (⇔)
↳10 TRUE
↳11 IDP
↳12 IDependencyGraphProof (⇔)
↳13 TRUE
↳14 IDP
↳15 IDPtoQDPProof (⇒)
↳16 QDP
↳17 MRRProof (⇔)
↳18 QDP
↳19 PisEmptyProof (⇔)
↳20 YES
public class ObjectList {
Object value;
ObjectList next;
public ObjectList(Object value, ObjectList next) {
this.value = value;
this.next = next;
}
public static ObjectList createList() {
ObjectList result = null;
int length = Random.random();
while (length > 0) {
result = new ObjectList(new Object(), result);
length--;
}
return result;
}
}
public class Random {
static String[] args;
static int index = 0;
public static int random() {
String string = args[index];
index++;
return string.length();
}
}
/**
* Allegedly based on an interview question at Microsoft.
*/
public class RunningPointers {
public static boolean isCyclic(ObjectList l) {
if (l == null) {
return false;
}
ObjectList l1, l2;
l1 = l;
l2 = l.next;
while (l2 != null && l1 != l2) {
l2 = l2.next;
if (l2 == null) {
return false;
}
else if (l2 == l1) {
return true;
}
else {
l2 = l2.next;
}
l1 = l1.next;
}
return l2 != null;
}
public static void main(String[] args) {
Random.args = args;
ObjectList list = ObjectList.createList();
isCyclic(list);
}
}
Generated 23 rules for P and 3 rules for R.
Combined rules. Obtained 1 rules for P and 1 rules for R.
Filtered ground terms:
325_0_createList_LE(x1, x2, x3) → 325_0_createList_LE(x2, x3)
Cond_325_0_createList_LE(x1, x2, x3, x4) → Cond_325_0_createList_LE(x1, x3, x4)
333_0_createList_Return(x1) → 333_0_createList_Return
Filtered duplicate args:
325_0_createList_LE(x1, x2) → 325_0_createList_LE(x2)
Cond_325_0_createList_LE(x1, x2, x3) → Cond_325_0_createList_LE(x1, x3)
Combined rules. Obtained 1 rules for P and 1 rules for R.
Finished conversion. Obtained 1 rules for P and 1 rules for R. System has predefined symbols.
Generated 33 rules for P and 66 rules for R.
Combined rules. Obtained 2 rules for P and 0 rules for R.
Filtered ground terms:
ObjectList(x1, x2) → ObjectList(x2)
1055_0_isCyclic_NULL(x1, x2, x3, x4) → 1055_0_isCyclic_NULL(x2, x3, x4)
Filtered duplicate args:
1055_0_isCyclic_NULL(x1, x2, x3) → 1055_0_isCyclic_NULL(x1, x3)
Finished conversion. Obtained 2 rules for P and 0 rules for R. System has no predefined symbols.
!= | ~ | Neq: (Integer, Integer) -> Boolean |
* | ~ | Mul: (Integer, Integer) -> Integer |
>= | ~ | Ge: (Integer, Integer) -> Boolean |
-1 | ~ | UnaryMinus: (Integer) -> Integer |
| | ~ | Bwor: (Integer, Integer) -> Integer |
/ | ~ | Div: (Integer, Integer) -> Integer |
= | ~ | Eq: (Integer, Integer) -> Boolean |
~ | Bwxor: (Integer, Integer) -> Integer | |
|| | ~ | Lor: (Boolean, Boolean) -> Boolean |
! | ~ | Lnot: (Boolean) -> Boolean |
< | ~ | Lt: (Integer, Integer) -> Boolean |
- | ~ | Sub: (Integer, Integer) -> Integer |
<= | ~ | Le: (Integer, Integer) -> Boolean |
> | ~ | Gt: (Integer, Integer) -> Boolean |
~ | ~ | Bwnot: (Integer) -> Integer |
% | ~ | Mod: (Integer, Integer) -> Integer |
& | ~ | Bwand: (Integer, Integer) -> Integer |
+ | ~ | Add: (Integer, Integer) -> Integer |
&& | ~ | Land: (Boolean, Boolean) -> Boolean |
Integer
(0) -> (1), if ((x0[0] > 0 →* TRUE)∧(x0[0] →* x0[1]))
(1) -> (0), if ((x0[1] + -1 →* x0[0]))
(1) (>(x0[0], 0)=TRUE∧x0[0]=x0[1] ⇒ 325_0_CREATELIST_LE(x0[0])≥NonInfC∧325_0_CREATELIST_LE(x0[0])≥COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])), ≥))
(2) (>(x0[0], 0)=TRUE ⇒ 325_0_CREATELIST_LE(x0[0])≥NonInfC∧325_0_CREATELIST_LE(x0[0])≥COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])∧(UIncreasing(COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])), ≥))
(3) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])), ≥)∧[(-1)Bound*bni_10] + [(2)bni_10]x0[0] ≥ 0∧[(-1)bso_11] ≥ 0)
(4) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])), ≥)∧[(-1)Bound*bni_10] + [(2)bni_10]x0[0] ≥ 0∧[(-1)bso_11] ≥ 0)
(5) (x0[0] + [-1] ≥ 0 ⇒ (UIncreasing(COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])), ≥)∧[(-1)Bound*bni_10] + [(2)bni_10]x0[0] ≥ 0∧[(-1)bso_11] ≥ 0)
(6) (x0[0] ≥ 0 ⇒ (UIncreasing(COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])), ≥)∧[(-1)Bound*bni_10 + (2)bni_10] + [(2)bni_10]x0[0] ≥ 0∧[(-1)bso_11] ≥ 0)
(7) (COND_325_0_CREATELIST_LE(TRUE, x0[1])≥NonInfC∧COND_325_0_CREATELIST_LE(TRUE, x0[1])≥325_0_CREATELIST_LE(+(x0[1], -1))∧(UIncreasing(325_0_CREATELIST_LE(+(x0[1], -1))), ≥))
(8) ((UIncreasing(325_0_CREATELIST_LE(+(x0[1], -1))), ≥)∧[2 + (-1)bso_13] ≥ 0)
(9) ((UIncreasing(325_0_CREATELIST_LE(+(x0[1], -1))), ≥)∧[2 + (-1)bso_13] ≥ 0)
(10) ((UIncreasing(325_0_CREATELIST_LE(+(x0[1], -1))), ≥)∧[2 + (-1)bso_13] ≥ 0)
(11) ((UIncreasing(325_0_CREATELIST_LE(+(x0[1], -1))), ≥)∧0 = 0∧[2 + (-1)bso_13] ≥ 0)
POL(TRUE) = 0
POL(FALSE) = 0
POL(325_0_createList_LE(x1)) = [-1]
POL(0) = 0
POL(333_0_createList_Return) = [-1]
POL(325_0_CREATELIST_LE(x1)) = [2]x1
POL(COND_325_0_CREATELIST_LE(x1, x2)) = [2]x2
POL(>(x1, x2)) = [-1]
POL(+(x1, x2)) = x1 + x2
POL(-1) = [-1]
COND_325_0_CREATELIST_LE(TRUE, x0[1]) → 325_0_CREATELIST_LE(+(x0[1], -1))
325_0_CREATELIST_LE(x0[0]) → COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])
325_0_CREATELIST_LE(x0[0]) → COND_325_0_CREATELIST_LE(>(x0[0], 0), x0[0])
!= | ~ | Neq: (Integer, Integer) -> Boolean |
* | ~ | Mul: (Integer, Integer) -> Integer |
>= | ~ | Ge: (Integer, Integer) -> Boolean |
-1 | ~ | UnaryMinus: (Integer) -> Integer |
| | ~ | Bwor: (Integer, Integer) -> Integer |
/ | ~ | Div: (Integer, Integer) -> Integer |
= | ~ | Eq: (Integer, Integer) -> Boolean |
~ | Bwxor: (Integer, Integer) -> Integer | |
|| | ~ | Lor: (Boolean, Boolean) -> Boolean |
! | ~ | Lnot: (Boolean) -> Boolean |
< | ~ | Lt: (Integer, Integer) -> Boolean |
- | ~ | Sub: (Integer, Integer) -> Integer |
<= | ~ | Le: (Integer, Integer) -> Boolean |
> | ~ | Gt: (Integer, Integer) -> Boolean |
~ | ~ | Bwnot: (Integer) -> Integer |
% | ~ | Mod: (Integer, Integer) -> Integer |
& | ~ | Bwand: (Integer, Integer) -> Integer |
+ | ~ | Add: (Integer, Integer) -> Integer |
&& | ~ | Land: (Boolean, Boolean) -> Boolean |
Integer
!= | ~ | Neq: (Integer, Integer) -> Boolean |
* | ~ | Mul: (Integer, Integer) -> Integer |
>= | ~ | Ge: (Integer, Integer) -> Boolean |
-1 | ~ | UnaryMinus: (Integer) -> Integer |
| | ~ | Bwor: (Integer, Integer) -> Integer |
/ | ~ | Div: (Integer, Integer) -> Integer |
= | ~ | Eq: (Integer, Integer) -> Boolean |
~ | Bwxor: (Integer, Integer) -> Integer | |
|| | ~ | Lor: (Boolean, Boolean) -> Boolean |
! | ~ | Lnot: (Boolean) -> Boolean |
< | ~ | Lt: (Integer, Integer) -> Boolean |
- | ~ | Sub: (Integer, Integer) -> Integer |
<= | ~ | Le: (Integer, Integer) -> Boolean |
> | ~ | Gt: (Integer, Integer) -> Boolean |
~ | ~ | Bwnot: (Integer) -> Integer |
% | ~ | Mod: (Integer, Integer) -> Integer |
& | ~ | Bwand: (Integer, Integer) -> Integer |
+ | ~ | Add: (Integer, Integer) -> Integer |
&& | ~ | Land: (Boolean, Boolean) -> Boolean |
Integer
!= | ~ | Neq: (Integer, Integer) -> Boolean |
* | ~ | Mul: (Integer, Integer) -> Integer |
>= | ~ | Ge: (Integer, Integer) -> Boolean |
-1 | ~ | UnaryMinus: (Integer) -> Integer |
| | ~ | Bwor: (Integer, Integer) -> Integer |
/ | ~ | Div: (Integer, Integer) -> Integer |
= | ~ | Eq: (Integer, Integer) -> Boolean |
~ | Bwxor: (Integer, Integer) -> Integer | |
|| | ~ | Lor: (Boolean, Boolean) -> Boolean |
! | ~ | Lnot: (Boolean) -> Boolean |
< | ~ | Lt: (Integer, Integer) -> Boolean |
- | ~ | Sub: (Integer, Integer) -> Integer |
<= | ~ | Le: (Integer, Integer) -> Boolean |
> | ~ | Gt: (Integer, Integer) -> Boolean |
~ | ~ | Bwnot: (Integer) -> Integer |
% | ~ | Mod: (Integer, Integer) -> Integer |
& | ~ | Bwand: (Integer, Integer) -> Integer |
+ | ~ | Add: (Integer, Integer) -> Integer |
&& | ~ | Land: (Boolean, Boolean) -> Boolean |
(0) -> (0), if ((1055_0_isCyclic_NULL(x0[0], java.lang.Object(x1[0])) →* 1055_0_isCyclic_NULL(java.lang.Object(ObjectList(x0[0]')), java.lang.Object(ObjectList(java.lang.Object(ObjectList(java.lang.Object(x1[0]')))))))∧(java.lang.Object(x2[0]) →* java.lang.Object(x2[0]')))
(0) -> (1), if ((1055_0_isCyclic_NULL(x0[0], java.lang.Object(x1[0])) →* 1055_0_isCyclic_NULL(java.lang.Object(ObjectList(x0[1])), java.lang.Object(ObjectList(java.lang.Object(ObjectList(java.lang.Object(x1[1])))))))∧(java.lang.Object(x2[0]) →* java.lang.Object(ObjectList(x0[1]))))
(1) -> (0), if ((1055_0_isCyclic_NULL(x0[1], java.lang.Object(x1[1])) →* 1055_0_isCyclic_NULL(java.lang.Object(ObjectList(x0[0])), java.lang.Object(ObjectList(java.lang.Object(ObjectList(java.lang.Object(x1[0])))))))∧(java.lang.Object(ObjectList(x0[1])) →* java.lang.Object(x2[0])))
(1) -> (1), if ((1055_0_isCyclic_NULL(x0[1], java.lang.Object(x1[1])) →* 1055_0_isCyclic_NULL(java.lang.Object(ObjectList(x0[1]')), java.lang.Object(ObjectList(java.lang.Object(ObjectList(java.lang.Object(x1[1]')))))))∧(java.lang.Object(ObjectList(x0[1])) →* java.lang.Object(ObjectList(x0[1]'))))
1055_1_MAIN_INVOKEMETHOD(1055_0_isCyclic_NULL(java.lang.Object(ObjectList(x0[0])), java.lang.Object(ObjectList(java.lang.Object(ObjectList(java.lang.Object(x1[0])))))), java.lang.Object(x2[0])) → 1055_1_MAIN_INVOKEMETHOD(1055_0_isCyclic_NULL(x0[0], java.lang.Object(x1[0])), java.lang.Object(x2[0]))
1055_1_MAIN_INVOKEMETHOD(1055_0_isCyclic_NULL(java.lang.Object(ObjectList(x0[1])), java.lang.Object(ObjectList(java.lang.Object(ObjectList(java.lang.Object(x1[1])))))), java.lang.Object(ObjectList(x0[1]))) → 1055_1_MAIN_INVOKEMETHOD(1055_0_isCyclic_NULL(x0[1], java.lang.Object(x1[1])), java.lang.Object(ObjectList(x0[1])))
1055_1_MAIN_INVOKEMETHOD(1055_0_isCyclic_NULL(java.lang.Object(ObjectList(x0[0])), java.lang.Object(ObjectList(java.lang.Object(ObjectList(java.lang.Object(x1[0])))))), java.lang.Object(x2[0])) → 1055_1_MAIN_INVOKEMETHOD(1055_0_isCyclic_NULL(x0[0], java.lang.Object(x1[0])), java.lang.Object(x2[0]))
1055_1_MAIN_INVOKEMETHOD(1055_0_isCyclic_NULL(java.lang.Object(ObjectList(x0[1])), java.lang.Object(ObjectList(java.lang.Object(ObjectList(java.lang.Object(x1[1])))))), java.lang.Object(ObjectList(x0[1]))) → 1055_1_MAIN_INVOKEMETHOD(1055_0_isCyclic_NULL(x0[1], java.lang.Object(x1[1])), java.lang.Object(ObjectList(x0[1])))
POL(1055_0_isCyclic_NULL(x1, x2)) = x1 + x2
POL(1055_1_MAIN_INVOKEMETHOD(x1, x2)) = x1 + x2
POL(ObjectList(x1)) = 1 + 2·x1
POL(java.lang.Object(x1)) = x1